home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Tools & Apps / Misc. Utilities / Installer 3.4 / Examples - Installer 3.4 / CustomOrder.r < prev    next >
Encoding:
Text File  |  1992-09-21  |  6.3 KB  |  169 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: setting package order in Custom Installation 
  6.  *
  7.  *    File:        CustomOrder.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  11.  *
  12.  *    Copyright © 1991 Apple Computer, Inc.
  13.  *    All rights reserved.
  14.  *
  15.  *------------------------------------------------------------------------------
  16.  * This installation sample is intended to only demonstrate how to organize the
  17.  * entries in your Custom Installation screen.  All of the packages contain the
  18.  * same infa to simplify the script.  We are not recommending that you do this in
  19.  * a real script.  Points to notice:  the ordering is equivalent to the order
  20.  * in this file NOT on the resource ID number.  To look at it in another way, the
  21.  * ordering is the same as the REVERSE order that is seen when using resEdit.
  22.  * This example also demonstrates a divider package, which is used to provide
  23.  * you with the ability to group (or separate) packages in the list of packages
  24.  * on the custom installation screen.
  25.  * 
  26.  * For demonstration purposes so that you can try this script out, the script
  27.  * reference TeachText as the sample application which each inpk installs to the 
  28.  * "Installed Application:" folder on the target volume.
  29.  *----------------------------------------------------------------------------*/
  30.  
  31. #include "InstallerTypes.r"
  32.  
  33. /* You can build and complete the script with the following lines:
  34. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  35. # or set up folders with the same names and contents as the floppies
  36. # put these folders in the same folder as the script or at the root directory of same disk
  37.  
  38.     rez -o "CustomOrder" -t 'bbkr' -c 'bbkr' "CustomOrder.r"
  39.     setfile -a i "CustomOrder"        #mark Inited
  40.     scriptcheck -p "CustomOrder"
  41. */
  42.  
  43. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  44. #define kScriptCheckSetsDate    0x01
  45.  
  46. /* Definitions for the file spec atoms (specifications for source and destination files) */
  47. #define fsSourceProgram            2000
  48. #define fsTargetProgram            2001
  49.  
  50. /* This is the name of the source disk */
  51. #define ProgramDisk "Program Disk:"
  52.  
  53. /* This is the target path for where we want to install the file. */
  54. #define TargetPath    ":Installed Application:"
  55.  
  56. /* Definition for the package. */
  57. #define pkTheProgram1            3000
  58. #define pkTheProgram2            3001
  59. #define pkTheProgram3            3002
  60. #define pkTheProgram4            3003
  61. #define pkDivider1                1
  62.  
  63. /* Definition for the file atom */
  64. #define faProgram                4000
  65.  
  66. /***************************** Package Resources ************************************************/
  67. resource 'inpk' (pkTheProgram1) {
  68.     format0 {
  69.         showsOnCustom,             /* Package appears in the Custom Install display */
  70.         removable,                /* Package can be removed */
  71.         dontForceRestart,        /* installing an app doesnt require rebooting */
  72.         0,                         /* 'icmt' not required */
  73.         0,                        /* Package size (filled in by ScriptCheck) */
  74.         "First Package", {        /* package name */
  75.             'infa', faProgram;
  76.         }
  77.     }
  78. };
  79.  
  80. resource 'inpk' (pkTheProgram2) {
  81.     format0 {
  82.         showsOnCustom,             /* Package appears in the Custom Install display */
  83.         removable,                /* Package can be removed */
  84.         dontForceRestart,        /* installing an app doesnt require rebooting */
  85.         0,                         /* 'icmt' not required */
  86.         0,                        /* Package size (filled in by ScriptCheck) */
  87.         "Second Package", {        /* package name */
  88.             'infa', faProgram;
  89.         }
  90.     }
  91. };
  92.  
  93. resource 'inpk' (pkDivider1) {
  94.     format0 {
  95.         showsOnCustom,             /* Package appears in the Custom Install display */
  96.         notRemovable,            /* Package can't be removed */
  97.         dontForceRestart,        /* divider doesnt require rebooting */
  98.         0,                         /* 'icmt' not required */
  99.         0,                        /* Package size (filled in by ScriptCheck) */
  100.         "-", {'    ', 0 }        /* package name - divider */
  101.     }
  102. };
  103.  
  104. resource 'inpk' (pkTheProgram4) {
  105.     format0 {
  106.         showsOnCustom,             /* Package appears in the Custom Install display */
  107.         removable,                /* Package can be removed */
  108.         dontForceRestart,        /* installing an app doesnt require rebooting */
  109.         0,                         /* 'icmt' not required */
  110.         0,                        /* Package size (filled in by ScriptCheck) */
  111.         "First Additional Package", {        /* package name */
  112.             'infa', faProgram;
  113.         }
  114.     }
  115. };
  116. resource 'inpk' (pkTheProgram3) {
  117.     format0 {
  118.         showsOnCustom,             /* Package appears in the Custom Install display */
  119.         removable,                /* Package can be removed */
  120.         dontForceRestart,        /* installing an app doesnt require rebooting */
  121.         0,                         /* 'icmt' not required */
  122.         0,                        /* Package size (filled in by ScriptCheck) */
  123.         "Second Additional Package", {        /* package name */
  124.             'infa', faProgram;
  125.         }
  126.     }
  127. };
  128.  
  129. /********************************************* File Specs ***************************************/
  130. /* Source File Specs */
  131. resource 'infs' (fsSourceProgram) {
  132.     'APPL',                                /* File Type */
  133.     'ttxt',                                /* Creator */
  134.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  135.     noSearchForFile,                    /* Do not search the source disk for the file */
  136.     typeCrMustMatch,                    /* file type and creator on this file must match */
  137.     ProgramDisk"TeachText"                /* Path to the file */
  138. };
  139.  
  140. /* Target File Specs */
  141. resource 'infs' (fsTargetProgram) {
  142.     'APPL',                                /* File Type */
  143.     'ttxt',                                /* Creator */
  144.     0,                                    /* not needed for target file spec */
  145.     noSearchForFile,                    /* Do not search the target disk for the file */
  146.     typeCrMustMatch,                    /* not needed for target file specs */
  147.     TargetPath"TeachText"                /* installation Path */
  148. };
  149.  
  150. /******************************************** File Atoms ************************************************/
  151. resource 'infa' (faProgram) {
  152.     format0 {
  153.         deleteWhenRemoving,                /* Delete the file if remove (option-custom) is clicked    */
  154.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  155.         copy,                             /* Copy the file to the destination */
  156.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  157.         updateExisting,                 /* replace an existing copy, if mine is newer */
  158.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  159.         rsrcFork, dataFork,                /* Copy both forks of the file */
  160.         fsTargetProgram,                /* TARGET file spec */
  161.         fsSourceProgram,                 /* SOURCE file spec */
  162.         0,                                /* atom size (filled in by ScriptCheck) */
  163.         ""                                /* Atom Description (for a file Installer will use file name) */
  164.     };
  165. };
  166.  
  167.  
  168.  
  169.